#include "../include/XCommanderMain.h"
#include <wx/msgdlg.h>

//(*InternalHeaders(XCommanderMain)
#include <wx/artprov.h>
#include <wx/bitmap.h>
#include <wx/intl.h>
#include <wx/image.h>
#include <wx/string.h>
//*)

//(*IdInit(XCommanderMain)
const long XCommanderMain::ID_LISTCTRL1 = wxNewId();
const long XCommanderMain::ID_LISTCTRL2 = wxNewId();
const long XCommanderMain::ID_SPLITTERWINDOW1 = wxNewId();
const long XCommanderMain::ID_MENUITEM1 = wxNewId();
const long XCommanderMain::ID_MENUITEM2 = wxNewId();
const long XCommanderMain::ID_STATUSBAR1 = wxNewId();
const long XCommanderMain::test1 = wxNewId();
const long XCommanderMain::test2 = wxNewId();
const long XCommanderMain::ID_TOOLBAR1 = wxNewId();
//*)

BEGIN_EVENT_TABLE(XCommanderMain,wxFrame)
	//(*EventTable(XCommanderMain)
	//*)
END_EVENT_TABLE()

XCommanderMain::XCommanderMain(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(XCommanderMain)
	Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
	SplitterWindow1 = new wxSplitterWindow(this, ID_SPLITTERWINDOW1, wxPoint(128,112), wxDefaultSize, wxSP_3D, _T("ID_SPLITTERWINDOW1"));
	SplitterWindow1->SetMinSize(wxSize(10,10));
	SplitterWindow1->SetMinimumPaneSize(10);
	ListCtrl1 = new wxListCtrl(SplitterWindow1, ID_LISTCTRL1, wxPoint(66,98), wxDefaultSize, 0, wxDefaultValidator, _T("ID_LISTCTRL1"));
	ListCtrl2 = new wxListCtrl(SplitterWindow1, ID_LISTCTRL2, wxPoint(335,193), wxDefaultSize, 0, wxDefaultValidator, _T("ID_LISTCTRL2"));
	SplitterWindow1->SplitVertically(ListCtrl1, ListCtrl2);
	MainMenuBar = new wxMenuBar();
	Menu1 = new wxMenu();
	MenuItem1 = new wxMenuItem(Menu1, ID_MENUITEM1, _("&Quit"), wxEmptyString, wxITEM_NORMAL);
	Menu1->Append(MenuItem1);
	MainMenuBar->Append(Menu1, _("&File"));
	Menu2 = new wxMenu();
	MenuItem2 = new wxMenuItem(Menu2, ID_MENUITEM2, _("&About"), wxEmptyString, wxITEM_NORMAL);
	Menu2->Append(MenuItem2);
	MainMenuBar->Append(Menu2, _("&About"));
	SetMenuBar(MainMenuBar);
	MainStatusBar = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
	int __wxStatusBarWidths_1[1] = { -10 };
	int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
	MainStatusBar->SetFieldsCount(1,__wxStatusBarWidths_1);
	MainStatusBar->SetStatusStyles(1,__wxStatusBarStyles_1);
	SetStatusBar(MainStatusBar);
	MainToolBar = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER, _T("ID_TOOLBAR1"));
	ToolBarItem1 = MainToolBar->AddTool(test1, _("test1"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_HARDDISK")),wxART_OTHER), wxNullBitmap, wxITEM_NORMAL, _("test1"), _("test1"));
	MainToolBar->AddSeparator();
	ToolBarItem2 = MainToolBar->AddTool(test2, _("test2"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_CDROM")),wxART_MENU), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
	MainToolBar->Realize();
	SetToolBar(MainToolBar);
	
	Connect(ID_MENUITEM1,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&XCommanderMain::OnQuit);
	Connect(ID_MENUITEM2,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&XCommanderMain::OnAbout);
	//*)
}

XCommanderMain::~XCommanderMain()
{
	//(*Destroy(XCommanderMain)
	//*)
}


void XCommanderMain::OnQuit(wxCommandEvent& event)
{
    Close();
}

void XCommanderMain::OnAbout(wxCommandEvent& event)
{
    wxString msg = _("XCommander");
    wxMessageBox(msg, _("Welcome to..."));
}
